Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
appium-logger
Advanced tools
Basic logger defaulting to npmlog with special consideration for running
tests (doesn't output logs when run with _TESTING=1
in the env).
There are a number of levels, exposed as methods on the log object, at which logging can be made. The built-in ones correspond to those of npmlog, and are:
silly
, verbose
, info
, http
, warn
, and error
. In addition there is a debug
level.
The default threshhold level is verbose
.
The logged output, by default, will be level prefix message
. So
import { getLogger } from 'appium-logger';
let log = getLogger('mymodule');
log.warn('a warning');`
Will produce
warn mymodule a warning
There are two environment variable flags that affect the way appium-logger
works.
_TESTING
_TESTING=1
stops output of logs when set to 1
._FORCE_LOGS
1
, reverses the _TESTING
log.level
log[level](message)
level
import { getLogger } from 'appium-logger';
let log = getLogger('mymodule');
log.info('hi!');
// => info mymodule hi!
log.unwrap()
retrieves the underlying npmlog object, in order to manage how logging is done at a low level (e.g., changing output streams, retrieving an array of messages, adding log levels, etc.).
import { getLogger } from 'appium-logger';
let log = getLogger('mymodule');
log.info('hi!');
let npmlogger = log.unwrap();
// any `npmlog` methods
let logs = npmlogger.record;
// logs === [ { id: 0, level: 'info', prefix: 'mymodule', message: 'hi!', messageRaw: [ 'hi!' ] }]
log.errorAndThrow(error)
logs the error passed in, at error
level, and then throws the error. If the error passed in is not an instance of Error (either directly, or a subclass of Error
) it will be wrapped in a generic Error
object.
import { getLogger } from 'appium-logger';
let log = getLogger('mymodule');
// previously there would be two lines
log.error('This is an error');
throw new Error('This is an error');
// now is compacted
log.errorAndThrow('This is an error');
FAQs
Logging utility for appium
The npm package appium-logger receives a total of 112 weekly downloads. As such, appium-logger popularity was classified as not popular.
We found that appium-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.